//
//  MusicManager.h
//  Slice
//
//  Created by lanou on 16/6/20.
//  Copyright © 2016年 wangjinchao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@protocol MusicManagerDelegate <NSObject>

@optional
//代理方法将当前时间和总时间传给外界
- (void)currentTime:(CGFloat)currentTime totalTime:(CGFloat)totalTime;

@end

@interface MusicManager : NSObject
//得到播放器对象
@property (nonatomic, retain) AVPlayer *player;

@property (nonatomic, retain) AVPlayerItem *item;

//声明代理属性
@property (nonatomic, weak) id<MusicManagerDelegate> delgate;
//播放状态的判断
@property (nonatomic,assign) BOOL isPlaying;

//获取播放器对象
+(instancetype) share;


//播放某个对象
- (void) playMusicWithStringURL:(NSString *)stringURL;

//播放的方法
- (void)play12;
//暂停播放
-(void)pause12;

@end
